<?php 

	/**
	* 构造方法
	*/

	//同名构造方法
	/*class Study{
		
		function Study()
		{
			echo "----Hello World-----";
		}
	}

	$a = new Study();
*/

	/**
	* 构造方法
	*/
	class brother
	{
		public $name;
		public $age;
		public $sex;
		public $height;

		function __construct($name, $age, $sex, $height)
		{
			$this->name = $name;
			$this->age  = $age;
			$this->sex  = $sex;
			$this->height=$height;
		}

		function dobrother()
		{
			echo "{$this->name}是大哥，他有{$this->age}岁了。。。";

			$this->dajia($this->height);
		}

		function dajia($height){
			if ($height >= 180) {
				echo "大哥打过了";
			}else{
				echo "打什么打。回家吧！！！";
			}
		}
	}

	$bt = new brother('张三', 20, '男', 179);
	$bt -> dobrother();

 ?>